<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2023/4/26
 * Time: 11:53
 */

namespace Database\Factories;


use App\Models\Color;
use Illuminate\Database\Eloquent\Factories\Factory;

class ColorFactory extends Factory
{
    /**
     * 虚拟客户添加方式：
     * php artisan thinker
     * \App\Models\Color::factory()->count(100)->create();
     */

    protected $model = Color::class;
    public function definition()
    {
        $colorName = fake()->colorName;//随机色名称
        $color = Color::where('color',$colorName)->first();

        return [

            'color'=>$colorName,

        ];
    }
}